
package io.lckgroup.modules.job.task;

import io.lckgroup.modules.lck.service.OrderMainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 每隔1分钟去查询待支付的订单，如果生成时间离现在大于15分钟，则取消订单
 *
 */
@Component("cancelOrder")
public class CancelOrderTask implements ITask {

	@Autowired
	private OrderMainService orderMainService;

	@Override
	public void run(String params){
		System.out.println("正在查询待支付的订单");
		int num = orderMainService.cancelOrderTask();
		System.out.println("修改了"+num+"个超时未支付的订单");
	}
}
